#ifndef _SEVEN_BUS_H_
#define _SEVEN_BUS_H_

#include <stdlib.h>
#include <stdint.h>

#include "periph/uart.h"
#include "periph/gpio.h"

#ifdef __cplusplus
extern "C" {
#endif


/**
 * @brief 
 * 
 */
typedef struct seven_bus_param {
    uart_t uart;
    uint8_t bus_addr; // bus address
    gpio_t cd_pin;
    uint32_t baudrate;
}seven_bus_param_t;

typedef struct {
    uint8_t msg_id;
    int (*fn)(void *pkt);
} seven_bus_callback_t;

/**
 * @brief 
 * 
 */
typedef struct seven_bus_dev {
    seven_bus_param_t param;
    int cb_len;
    seven_bus_callback_t *cb_array;
}seven_bus_dev_t;

/**
 * @brief 
 * 
 * @param dev 
 * @return int 
 */
int seven_bus_init(seven_bus_dev_t *dev, uint8_t priority);

#ifdef __cplusplus
}
#endif

#endif

